package com.yfp.operation.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yfp.operation.domain.PositionSharing;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Description: 点位分成
 *
 * @CreateDate: 2024/6/14 17:35
 * @UpdateUser:
 * @UpdateDate: 2024/6/14 17:35
 * @UpdateRemark: 暂无修改
 * @Version: 1.0
 */
@Mapper
public interface PositionSharingMapper extends BaseMapper<PositionSharing> {

    /**
     * 查询
     *
     * @param id
     * @return
     */
    PositionSharing getById(@Param("id") Long id);

    /**
     * 查询
     *
     * @param positionId
     * @return
     */
    List<PositionSharing> getByPositionId(@Param("positionId") String positionId);

    /**
     * 新增
     *
     * @param positionSharing
     */
    void add(PositionSharing positionSharing);

    /**
     * 编辑
     *
     * @param positionSharing
     */
    void edit(PositionSharing positionSharing);

    /**
     * 删除
     *
     * @param positionId
     */
    void delByPositionId(@Param("positionId") String positionId);

    /**
     * 根据设备id批量查询
     *
     * @param machineIds
     * @return
     */
    List<PositionSharing> findByMachineIds(@Param("machineIds") List<String> machineIds);

    /**
     * 查询
     *
     * @param positionId
     * @param userId
     * @return
     */
    List<PositionSharing> getByPositionIdAndUserId(@Param("positionId") String positionId, @Param("userId") Long userId);


    /**
     * 查询
     *
     * @param positionIds
     * @param userId
     * @return
     */
    List<PositionSharing> getByPositionIdsAndUserId(@Param("positionIds") List<String> positionIds, @Param("userId") Long userId);

    List<String> getPositionSharing(String accountNumber);

    /**
     * 查询所有分账
     *
     * @return
     */
    List<PositionSharing> findAll();

    /**
     * 根据用户id查询
     *
     * @param userId
     * @return
     */
    List<PositionSharing> getByUserId(Long userId);
}
